package com.platform.boot.converters;


import com.platform.boot.annotation.UserAuditor;
import lombok.NonNull;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.ReadingConverter;

/**
 * @author Alex bob(<a href="https://github.com/vnobo">https://github.com/vnobo</a>)
 */
@ReadingConverter
public class UserAuditorReadConverter implements Converter<String, UserAuditor> {

    @Override
    public UserAuditor convert(@NonNull String source) {
        return UserAuditor.withUsername(source);
    }
}